﻿/**
 * @file guild_building_timer.h
 * @date 2021/07/27 20:07
 * 
 * @author harrybao (harrybao@123u.com)
 * 
 * @brief 工会建筑升级定时器
 * 
 * @version v1.0.0
 * 
 * @copyright Copyright © 2021 All Rights Reserved 上海欢乐互娱网络科技有限公司
 * 
 * @par history:
 * <table>
 * <tr><th>Date                     <th>Version     <th>Author      <th>Description
 * <tr><td>2021/07/27 20:07         <td>1.0.0       <td>harrybao    <td>创建初始版本
 * </table>
 */

#pragma once

#include "timer/service_timer_base.hpp"
#include "guild/guild.h"

namespace guild_service {

/**
 * @brief 公会建筑定时器类
 * 
 */
class GuildBuildingUpgradeTimer : public detail::service_timer_base {
public:
 GuildBuildingUpgradeTimer() : m_guild_id(kInvalidGuildId), m_building_id(0) {}
 GuildBuildingUpgradeTimer(guild_id_type guild_id, uint32_t building_id)
     : m_guild_id(guild_id), m_building_id(building_id) {}
 virtual ~GuildBuildingUpgradeTimer() = default;
public:
  /**
   * @brief 
   * 
   * @param usr_data 
   * @param ms 
   * @return true 
   * @return false 
   */
  virtual bool timer_callback(uint64_t usr_data, time_t ms) override;
  
  /**
   * @brief 
   * 
   * @return time_t 
   */
  virtual time_t duration() override { return 5000; }

  /**
   * @brief 
   * 
   * @return timer_type 
   */
  virtual detail::timer_type type() override {
    return detail::timer_type::TIMER_TYPE_ONCE;
  }
private:
  guild_id_type m_guild_id;     ///< 公会id
  uint32_t m_building_id;       ///< 建筑id
};

}  // namespace guild_service